﻿<catel:DataWindow x:Class="Catel.Examples.WPF.Validation.Views.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				  xmlns:catel="http://catel.codeplex.com"
                  ShowInTaskbar="True" ResizeMode="NoResize"
                  Icon="/Resources/Icons/Catel.ico">

    <!-- Resources -->
    <catel:DataWindow.Resources>
    </catel:DataWindow.Resources>

    <!-- Content -->
    <catel:StackGrid>
        <catel:StackGrid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </catel:StackGrid.RowDefinitions>

        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="400" />
        </catel:StackGrid.ColumnDefinitions>

        <Label>
            <TextBlock TextWrapping="Wrap">
                This demo applications shows the different types of validation that are available in Catel. Each demo has its own models and view 
                models with the corresponding names so it should be fairly easy to find the code per example.
                <LineBreak />
                <LineBreak />
                At first sight, you won't see a difference, but each button shows a different kind of validation (which shows how flexible and
                powerful the validation mechanism in Catel is).
            </TextBlock>
        </Label>
        
        <CheckBox IsChecked="{Binding EnableDeferValidationUntilFirstSave}" Content="Defer validation until first save" />
        
        <Button Command="{Binding OpenValidationViaValidateMethods}" Content="Validation in view model via Validate methods" />
        <Button Command="{Binding OpenValidationViaDataAnnotations}" Content="Validation in view model via data annotations (attributes)" />

        <Button Command="{Binding OpenValidationInModel}" Content="Validation in model" />

        <Button Command="{Binding OpenValidationInIValidator}" Content="Validation in IValidator" />
        
        <Button Command="{Binding OpenValidationViaFluentValidation}" Content="Validation via FluentValidation Extension" />
    </catel:StackGrid>
</catel:DataWindow>
